package org.cskj.demo.service.imp;

import org.cskj.demo.mapper.InshopMapper;
import org.cskj.demo.mapper.OutshopMapper;
import org.cskj.demo.pojo.Inshop;
import org.cskj.demo.pojo.Outshop;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class OutshopService {
    @Autowired
    private OutshopMapper outshopMapper;
    public List<Outshop> selectAll(int page,int pagesize){
        Map map=new HashMap();
        map.put("start",(page-1)*pagesize);
        map.put("end",pagesize);
        List<Outshop> list = outshopMapper.selectAll(map);
        return list;
    }
    public int count(){
        int i = outshopMapper.countByExample(null);
        return i;
    }
    public int insert(Outshop outshop){
        int i = outshopMapper.insertSelective(outshop);
        return i;
    }
    public Outshop selectByKey(int id){
        Outshop outshop = outshopMapper.selectByPrimaryKey(id);
        return outshop;
    }
}
